#include "pch.h"
#include "ChanLunWithC.h"

vector<KLine*>* ChanLunWithC::initKLinesWithC(int dataLen, float* high, float* low, float* close) {
	IPoint* point = new PointWithC();
	vector<KLine*>* kLines = initKLines(dataLen, high, low, close);
	point->setPointTag(kLines);
	delete point;
	return kLines;
}

void ChanLunWithC::drawSegment(int dataLen, float* pfOUT, float* high, float* low, float* close) {
	vector<KLine*>* kLines = initKLinesWithC(dataLen, high, low, close);
	ISegment* segment = new SegmentWithC();
	segment->drawSegment(dataLen, pfOUT, kLines);
	delete segment;
	clearKLines(kLines);
}

void ChanLunWithC::drawCenterHigh(int dataLen, float* pfOUT, float* high, float* low, float* close) {
	vector<KLine*>* kLines = initKLinesWithC(dataLen, high, low, close);
	ICenter* center = new CenterWithC();
	center->outCenterHigh(kLines, pfOUT);
	delete center;
	clearKLines(kLines);
}

void ChanLunWithC::drawCenterLow(int dataLen, float* pfOUT, float* high, float* low, float* close) {
	vector<KLine*>* kLines = initKLinesWithC(dataLen, high, low, close);
	ICenter* center = new CenterWithC();
	center->outCenterLow(kLines, pfOUT);
	delete center;
	clearKLines(kLines);
}